<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>信息登记</title>
	<meta name="decorator" content="default"/>
	<link href="${ctxStatic}/file/css/fileinput.css"  rel="stylesheet" type="text/css" />  
	<script src="${ctxStatic}/file/js/fileinput.min.js" type="text/javascript"></script>  
	 <script src="${ctxStatic}/file/js/fileinput_locale_zh.js" type="text/javascript"></script> 
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
		function chong(){
			var b=$("#did").val();//获取当前用户重新赋值
		    $(':input,#inputForm')  
	         .not(':button, :submit, :reset, :hidden')  
	         .val('')  
	         .removeAttr('checked')  
	         .removeAttr('selected');   
		    $("#did").val(b);
		}

		
		
		function shang(){
			$('#demoModal').modal('show');
		}
		
		function shangchuan(){
			var form = new FormData(document.getElementById("userfile"));
			 form.append("file", form); 
		    $.ajax({  
		         url : "${ctx}/numberinfo/yhcgNumberinfo/file",  
		         type : "POST",  
		         data : form,
		         contentType: false,
		         processData: false,
		         success : function(data) {  
		        	$("#filechuname").val(data.name);
		        	$("#filetuurl").val(data.url);
		        	document.getElementById("sfd").innerHTML=data.name;
		             alert("上传成功");
		         },  
		         error : function(data) {  
		             alert("上传失败");
		         }  
		    });  
		}
		
		function chu(){
			$('#jid').show();
			$('#tid').show();
			$('#uid').show();
			$('#chuid').show();
			$('#chuide').hide();
		}
		function qu(){
			$('#jid').hide();
			$('#tid').hide();
			$('#uid').hide();
			$('#chuid').hide();
			$('#chuide').show();
		}
	</script>
	<style type="text/css">
	#cs1,#cs2,#tid1,#tid2,#tid3,#tid4,.input-medium{
	width: 60%
	}
	
	#tid{
	width: 25%
	}
	</style>
</head>
<body>
<div>
	<%-- <ul class="nav nav-tabs">
		<li><a href="${ctx}/numberinfo/yhcgNumberinfo/">任务处置</a></li>
	</ul><br/> --%>
	<form:form id="inputForm" modelAttribute="yhcgNumberinfo" action="${ctx}/numberinfo/yhcgNumberinfo/formdatachusave" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>	
		<table >
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【联系人信息】</h4></td></tr>
		<tr><td>
		<div class="control-group">
			<label class="control-label">姓名：</label>
			<div class="controls">
			${yhcgNumberinfo.name}
			</div>
		</div>
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">电话：</label>
			<div class="controls">
			${yhcgNumberinfo.phone}
			</div>
		</div>
		</td>
		</tr>
			<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【内容描述】</h4></td></tr>
		<tr>
		<td>
		<div class="control-group">
			<label class="control-label">来源：</label>
			<div class="controls">
				${fns:getDictLabel(yhcgNumberinfo.come, 'come_type', '')}
			</div>
		</div>
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">事件类别：</label>
			<div class="controls">
			${fns:getDictLabel(yhcgNumberinfo.type, 'type_type', '')}
			</div>
		</div>
		</td>
		
		</tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">附件信息：</label>
			<div class="controls">
				<span id="sfid">
				${name}
				</span>
			</div>
		</div>
		</td>
		</tr>
		<tr>
		<td colspan="4">
			<div class="control-group">
			<label class="control-label">内容：</label>
			<div class="controls">
			${yhcgNumberinfo.content}
			</div>
		</div>
		</td>
		
		<tr>
		<td colspan="4">
		<div class="control-group">
			<label class="control-label">备注：</label>
			<div class="controls">
			${yhcgNumberinfo.remark}
			</div>
		</div>
		</td>
		</tr>
		<tr>
		<td>
		<div class="control-group">
			<label class="control-label">登记人：</label>
			<div class="controls">
			${yhcgNumberinfo.registrant}
			</div>
		</div>
	
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">办理人：</label>
			<div class="controls"> 
		${yhcgNumberinfo.administrator}
			</div>
		</div>
		</td>
		</tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">办理期限：</label>
			<div class="controls">
			<fmt:formatDate value="${yhcgNumberinfo.timelimit}" pattern="yyyy-MM-dd HH:mm:ss"/>
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【分流派遣】</h4></td></tr>
		
		<tr>
		<td>
		<div class="control-group">
			<label class="control-label">责任单位：</label>
			<div class="controls">
			${yhcgNumberinfo.zenname}
			</div>
		</div>
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">督办单位：</label>
			<div class="controls">
			${yhcgNumberinfo.duname}
			</div>
		</div>
		</td>
		</tr>
		<tr style="display:none" id="jid">
		<td colspan="2">
			<div class="control-group">
			<label class="control-label">处理结果：</label>
			<div class="controls">
		<form:textarea path="contentchu" htmlEscape="false" rows="6" class="input-xxlarge required" id="cs1"/>
			</div>
		</div>
		</td>
		</tr>
		<tr style="display:none" id="tid">
		<td colspan="2">
			<div class="control-group">
			<label class="control-label">整改后图片：</label>
			<div class="controls">
			<form:hidden path="filechuname" htmlEscape="false" maxlength="255" class="input-xlarge" />
				<form:hidden path="filetuurl" htmlEscape="false" maxlength="255" class="input-xlarge" />
				<input id="btnSubmitshang" class="btn btn-primary" type="button" value="附件上传" onclick="shang()"/>
				<span id="sfd">
				</span>
			</div>
		</div>
		</td>
		</tr>
		<tr style="display:none" id="uid">
		<td colspan="2">
			<div class="control-group">
			<label class="control-label">处理人：</label>
			<div class="controls">
			<form:input path="chuuser" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
			</div>
		</div>
		</td>
		</tr>
		</table>
		<div class="form-actions" id="chuide">
			<input id="btnSubmit" class="btn btn-primary" type="button" value="处理"  onclick="chu()"/>&nbsp;
		</div>
		<div class="form-actions" id="chuid" style="display:none">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="提交" />&nbsp;
			<input id="btnSubmit" class="btn btn-default" type="button" value="取消"  onclick="qu()"/>&nbsp;
		</div>
	</form:form>
	</div>
	<div class="modal fade" id="demoModal" tabindex="-1" role="dialog" aria-labelledby="demoModalLabel" aria-hidden="true" data-backdrop="static" style="width: 300px;">
        <div class="modal-dialog" >
             <div class="modal-content">
                 <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                      <h4 class="modal-title" id="demoModalLabel">文件上传</h4>
                 </div>
                 <div class="modal-body" style="height: 150px;">
                     <form action="" method="post" id="userfile" enctype="multipart/form-data">
			        	<input type="file" name="file" id="file"  /> 
     				   </form>  
                     <button type="button" class="btn btn-default" data-dismiss="modal" onclick="shangchuan()" >上传</button>
                     </div>
             </div>
         </div>
    </div>
</body>
</html>